package xj.graph2d.graph;

import java.io.OutputStream;
import java.io.PrintWriter;

public interface Graph <NodeType extends GraphNode<EdgeType>, 
			EdgeType extends GraphEdge<NodeType>>
  extends Subgraph<NodeType, EdgeType> { 

  public boolean isDirected();

  public void setDirected(boolean directed);

  public boolean isStrict();

  public void setStrict(boolean strict);

  /*
   * return true if there is a path from src to des
   */
  public boolean isReachable(NodeType src, NodeType des);

  public void setGraphLayoutManager(GraphLayoutManager layoutMgr);

  public GraphLayoutManager getGraphLayoutManager();

  public void doLayout();

  public void layoutEdges();

  public String getIndent();

  public void incrementIndent();

  public void decrementIndent();

  public void print();

  /**
   * Output graph to specified Writer.
   * 
   * @param output
   *                the Writer for writing
   */
  public void printGraph(PrintWriter output);

  /**
   * Output graph to specified OutputStream. A convenience method to
   * accomodate the OuputStreams easily.
   * 
   * @param output
   *                the OutputStream for writing
   */
  public void printGraph(OutputStream output);

}
